home *** CD-ROM | disk | FTP | other *** search
/ Pro One: Netcracker Netscape Navigator / ProOne: Netcracker Netscape Navigator.iso / pc / nc / wds / nc_find2.geo / 00016.ls < prev    next >
Encoding:
Text File  |  1997-03-19  |  7.6 KB  |  319 lines

  1. on init
  2.   set_find2MaxLines(8)
  3.   set_find2WhichText(field "ALL_DATA")
  4.   set_find2FieldScroll(the number of cast "currScroll")
  5.   set_find2NumOflines(the number of lines in get_find2WhichText())
  6.   set the textHeight of field get_find2FieldScroll() to 14
  7.   set_find2SliderSprite(10)
  8.   set_find2ThumbSprite(13)
  9.   set_find2CurrPlace(0)
  10.   set_find2ConstraintSprite(15)
  11.   set_find2DisableSprite(17)
  12.   set_find2HiliteSprite(19)
  13.   set_find2SizeOfLine(14)
  14.   set_find2TopField(the top of sprite 16)
  15.   set_find2SelectedLine(1)
  16.   puppetSprite(get_find2HiliteSprite(), 1)
  17.   puppetSprite(get_find2ThumbSprite(), 1)
  18.   set the immediate of sprite get_find2ThumbSprite() to 1
  19.   set_find2SliderHeight(the height of sprite get_find2ConstraintSprite())
  20.   set_find2Options(get_find2NumOflines() - get_find2MaxLines())
  21.   set the visible of sprite get_find2DisableSprite() to not (get_find2Options() > 0)
  22.   if get_find2Options() > 0 then
  23.     set the cursor of sprite 10 to [404, 405]
  24.     set the cursor of sprite 11 to [404, 405]
  25.     set the cursor of sprite 12 to [404, 405]
  26.   else
  27.     set the cursor of sprite 10 to [400, 401]
  28.     set the cursor of sprite 11 to [400, 401]
  29.     set the cursor of sprite 12 to [400, 401]
  30.   end if
  31.   if get_find2Options() > 0 then
  32.     set_find2Increment(1.0 * get_find2SliderHeight() / get_find2Options())
  33.   end if
  34.   set_find2TopLoc(the top of sprite get_find2ConstraintSprite())
  35.   PlaceSlider()
  36. end
  37.  
  38. on ChooseLine
  39.   global cardlist, find2Links
  40.   set TopLoc to get_find2TopField()
  41.   set VerticalLoc to getAt(the clickLoc, 2)
  42.   set NumOfline to (VerticalLoc - TopLoc) / get_find2SizeOfLine()
  43.   if (NumOfline + 1) <= get_find2NumOflines() then
  44.     set newLoc to (NumOfline * get_find2SizeOfLine()) + TopLoc
  45.     set the locV of sprite get_find2HiliteSprite() to newLoc
  46.     set_find2SelectedLine(get_find2CurrPlace() + NumOfline + 1)
  47.     updateStage()
  48.   end if
  49. end
  50.  
  51. on UpdateHilight
  52.   if (get_find2SelectedLine() <> EMPTY) and (get_find2SelectedLine() > get_find2CurrPlace()) and ((get_find2SelectedLine() - 1) < (get_find2CurrPlace() + get_find2MaxLines())) then
  53.     set TopLoc to get_find2TopField()
  54.     set newLoc to ((get_find2SelectedLine() - get_find2CurrPlace() - 1) * get_find2SizeOfLine()) + TopLoc
  55.     set the locV of sprite get_find2HiliteSprite() to newLoc
  56.   else
  57.     set the locV of sprite get_find2HiliteSprite() to 999
  58.   end if
  59.   updateStage()
  60. end
  61.  
  62. on SliderActive
  63.   repeat while the stillDown
  64.     if rollOver(16) then
  65.       set newV to constrainV(get_find2ConstraintSprite(), mouseV())
  66.       set the locV of sprite get_find2ThumbSprite() to newV
  67.       set newValue to integer((newV - get_find2TopLoc()) / get_find2Increment())
  68.       set_find2CurrPlace(newValue)
  69.       UpdateHilight()
  70.       put line get_find2CurrPlace() + 1 to get_find2CurrPlace() + get_find2MaxLines() of get_find2WhichText() into field get_find2FieldScroll()
  71.     end if
  72.   end repeat
  73. end
  74.  
  75. on PlaceMySlider
  76.   put line 1 to 16 of get_find2WhichText() into field "currScroll"
  77. end
  78.  
  79. on PlaceSlider
  80.   set currentValue to get_find2CurrPlace()
  81.   if get_find2Options() > 0 then
  82.     set newPlace to get_find2TopLoc() + integer(get_find2Increment() * currentValue)
  83.     set the locV of sprite get_find2ThumbSprite() to newPlace
  84.     updateStage()
  85.   end if
  86.   UpdateHilight()
  87.   put line get_find2CurrPlace() + 1 to get_find2CurrPlace() + get_find2MaxLines() of get_find2WhichText() into field get_find2FieldScroll()
  88. end
  89.  
  90. on ClickSlider toSub
  91.   if not toSub then
  92.     set_find2CurrPlace(get_find2CurrPlace() - get_find2MaxLines() + 1)
  93.   else
  94.     set_find2CurrPlace(get_find2CurrPlace() + get_find2MaxLines() - 1)
  95.   end if
  96.   if get_find2CurrPlace() < 0 then
  97.     set_find2CurrPlace(0)
  98.   else
  99.     if (get_find2CurrPlace() + get_find2MaxLines()) > get_find2NumOflines() then
  100.       set_find2CurrPlace(get_find2NumOflines() - get_find2MaxLines())
  101.     end if
  102.   end if
  103.   PlaceSlider()
  104. end
  105.  
  106. on handleUP
  107.   set_find2StepMeter("decrease")
  108. end
  109.  
  110. on handleDown
  111.   set_find2StepMeter("increase")
  112. end
  113.  
  114. on set_find2StepMeter direction
  115.   set currentValue to get_find2CurrPlace()
  116.   if (direction = "increase") and (currentValue <> get_find2Options()) then
  117.     set_find2CurrPlace(currentValue + 1)
  118.   else
  119.     if (direction = "decrease") and (currentValue <> 0) then
  120.       set_find2CurrPlace(currentValue - 1)
  121.     end if
  122.   end if
  123.   PlaceSlider()
  124. end
  125.  
  126. on ClickScroll spriteNum, castDown, macroName
  127.   set flag to 0
  128.   set SaveCast to the castNum of sprite spriteNum
  129.   set flag to swapScroll(spriteNum, SaveCast, castDown)
  130.   repeat while the stillDown
  131.     set flag to swapScroll(spriteNum, SaveCast, castDown)
  132.     if flag = 1 then
  133.       do(macroName)
  134.     end if
  135.   end repeat
  136. end
  137.  
  138. on swapScroll spriteNum, SaveCast, castDown
  139.   if rollOver(spriteNum) then
  140.     set the castNum of sprite spriteNum to the number of cast castDown
  141.     updateStage()
  142.     return 1
  143.   else
  144.     set the castNum of sprite spriteNum to the number of cast SaveCast
  145.     updateStage()
  146.     return 0
  147.   end if
  148. end
  149.  
  150. on set_find2SliderSprite int
  151.   global find2SliderSprite
  152.   set find2SliderSprite to int
  153. end
  154.  
  155. on get_find2SliderSprite
  156.   global find2SliderSprite
  157.   return find2SliderSprite
  158. end
  159.  
  160. on set_find2ThumbSprite int
  161.   global find2ThumbSprite
  162.   set find2ThumbSprite to int
  163. end
  164.  
  165. on get_find2ThumbSprite
  166.   global find2ThumbSprite
  167.   return find2ThumbSprite
  168. end
  169.  
  170. on set_find2CurrPlace int
  171.   global find2CurrPlace
  172.   set find2CurrPlace to int
  173. end
  174.  
  175. on get_find2CurrPlace
  176.   global find2CurrPlace
  177.   return find2CurrPlace
  178. end
  179.  
  180. on set_find2SliderHeight int
  181.   global find2SliderHeight
  182.   set find2SliderHeight to int
  183. end
  184.  
  185. on get_find2SliderHeight
  186.   global find2SliderHeight
  187.   return find2SliderHeight
  188. end
  189.  
  190. on set_find2Increment int
  191.   global find2Increment
  192.   set find2Increment to int
  193. end
  194.  
  195. on get_find2Increment
  196.   global find2Increment
  197.   return find2Increment
  198. end
  199.  
  200. on set_find2TopLoc int
  201.   global find2TopLoc
  202.   set find2TopLoc to int
  203. end
  204.  
  205. on get_find2TopLoc
  206.   global find2TopLoc
  207.   return find2TopLoc
  208. end
  209.  
  210. on set_find2Options int
  211.   global find2Options
  212.   set find2Options to int
  213. end
  214.  
  215. on get_find2Options
  216.   global find2Options
  217.   return find2Options
  218. end
  219.  
  220. on set_find2MaxLines int
  221.   global find2MaxLines
  222.   set find2MaxLines to int
  223. end
  224.  
  225. on get_find2MaxLines
  226.   global find2MaxLines
  227.   return find2MaxLines
  228. end
  229.  
  230. on set_find2WhichText str
  231.   global find2WhichText
  232.   set find2WhichText to str
  233. end
  234.  
  235. on get_find2WhichText
  236.   global find2WhichText
  237.   return find2WhichText
  238. end
  239.  
  240. on set_find2FieldScroll int
  241.   global find2FieldScroll
  242.   set find2FieldScroll to int
  243. end
  244.  
  245. on get_find2FieldScroll
  246.   global find2FieldScroll
  247.   return find2FieldScroll
  248. end
  249.  
  250. on set_find2NumOflines int
  251.   global find2NumOflines
  252.   set find2NumOflines to int
  253. end
  254.  
  255. on get_find2NumOflines
  256.   global find2NumOflines
  257.   return find2NumOflines
  258. end
  259.  
  260. on set_find2ConstraintSprite int
  261.   global find2ConstraintSprite
  262.   set find2ConstraintSprite to int
  263. end
  264.  
  265. on get_find2ConstraintSprite
  266.   global find2ConstraintSprite
  267.   return find2ConstraintSprite
  268. end
  269.  
  270. on set_find2DisableSprite int
  271.   global find2DisableSprite
  272.   set find2DisableSprite to int
  273. end
  274.  
  275. on get_find2DisableSprite
  276.   global find2DisableSprite
  277.   return find2DisableSprite
  278. end
  279.  
  280. on set_find2HiliteSprite int
  281.   global find2HiliteSprite
  282.   set find2HiliteSprite to int
  283. end
  284.  
  285. on get_find2HiliteSprite
  286.   global find2HiliteSprite
  287.   return find2HiliteSprite
  288. end
  289.  
  290. on set_find2SizeOfLine int
  291.   global find2SizeOfLine
  292.   set find2SizeOfLine to int
  293. end
  294.  
  295. on get_find2SizeOfLine
  296.   global find2SizeOfLine
  297.   return find2SizeOfLine
  298. end
  299.  
  300. on set_find2SelectedLine int
  301.   global find2SelectedLine
  302.   set find2SelectedLine to int
  303. end
  304.  
  305. on get_find2SelectedLine
  306.   global find2SelectedLine
  307.   return find2SelectedLine
  308. end
  309.  
  310. on set_find2TopField int
  311.   global find2TopField
  312.   set find2TopField to int
  313. end
  314.  
  315. on get_find2TopField
  316.   global find2TopField
  317.   return find2TopField
  318. end
  319.